package cn.edu.swpu.sims.service.impl;

import cn.edu.swpu.sims.dao.StudentDao;
import cn.edu.swpu.sims.model.Student;
import cn.edu.swpu.sims.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 码之泪殇
 * @date 2020/9/12 15:28
 * 到达胜利之前，无法回头
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public Student getStudentBySno(String sno) {
        return studentDao.getStudentBySno(sno);
    }

    @Override
    public List<Student> getAllStudent(String type, String value) {
        return studentDao.getAllStudent(type, value);
    }

    @Override
    public int saveStudent(Student student) {
        return studentDao.saveStudent(student);
    }

    @Override
    public void deleteStudentById(int id) {
        studentDao.deleteStudentById(id);
    }

    @Override
    public Student getStudentById(int id) {
        return studentDao.getStudentById(id);
    }

    @Override
    public int updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }
}
